home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-05-21 | 368 b | 18 lines | [TEXT/ttxt] |
- --<<<
- -- Kaleida Labs, Inc.
- -- Field Guide to the ScriptX Language
- -- chapter 5, example 5
-
- -- using apply to call functions
-
- function addEmUp #rest args -> (
- local sum := 0
- for i in args do sum := sum + i
- return sum
- )
- global a := #(1,4,9,16)
- global b := 1 to (a.size)
- myArgs := merge a b
- -- use apply to call function with rest arguments
- apply addEmUp myArgs
- -->>>